UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zp1mRaQgOATtLxCtWeEMa4sa4GIE6Zf55r9oegL/EzI='
WHERE
key_id = 'e4775a1f36e7c6afd3cb6f27840bdc124e0e3489a25ced97f1a82dab5deba45a'
AND (
token = 'Zp1mRaQgOATtLxCtWeEMa4sa4GIE6Zf55r9oegL/EzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)