UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8uEFmAP7zor6ZmdtrxQjUV6TS/9uw0v9g4VzidSAayw='
WHERE
key_id = '55ecb6560af7407ee2233468f946e562311b06b2123c4737c8574abbd78cdddc'
AND (
token = '8uEFmAP7zor6ZmdtrxQjUV6TS/9uw0v9g4VzidSAayw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)