UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dIWdswhZG/k/W3Mx9kyH8vWEP7CDi4SFmRZBHGJyYlA='
WHERE
key_id = '841697bf6dcee9c60e638214c864da6b2136444a8a93cd503864f80d6623a314'
AND (
token = 'dIWdswhZG/k/W3Mx9kyH8vWEP7CDi4SFmRZBHGJyYlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)