UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WueaU7n14EHFW5AqH4lD4N84yvl2D7/N6La1TP/5UQI='
WHERE
key_id = '4d74915d1401de851b89b3d5aaabd95517752a6238c8734bf32c9f6433548577'
AND (
token = 'WueaU7n14EHFW5AqH4lD4N84yvl2D7/N6La1TP/5UQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)