UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jGDSjSYGjxKAGjPy2OiwyTFuFUtYKm7lKIfo0YE98uk='
WHERE
key_id = 'a34067a934b8e506bbeb452193c41c7b95152d9586974ec74f2bd4463a8ca5b8'
AND (
token = 'jGDSjSYGjxKAGjPy2OiwyTFuFUtYKm7lKIfo0YE98uk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)