UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uNVy3wkZwZrZSuICKPlVWYKH6dZjoEYNcnI+8QAl+aQ='
WHERE
key_id = '9f9ed5ade99035fa64d32aeb64fb38151a4d4cab6cf60c1c454f52601c43f19b'
AND (
token = 'uNVy3wkZwZrZSuICKPlVWYKH6dZjoEYNcnI+8QAl+aQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)