UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jyfOqWqU7w0BdwRpIFPS/2hSA9OXBNknC+ZxbfLORd0='
WHERE
key_id = '037c207925e419264cf9f664c8b1dffabf25b2d794e0be30a7a7a3773c58ce0d'
AND (
token = 'jyfOqWqU7w0BdwRpIFPS/2hSA9OXBNknC+ZxbfLORd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)