UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WNTkxvlLMFegjTlX+Xq7LBBd+mY2SxIXvHZ6CocIQo8='
WHERE
key_id = '15bfd9ca05c6283157a0c80ede747ef41810934eccb23f47c105245133b45437'
AND (
token = 'WNTkxvlLMFegjTlX+Xq7LBBd+mY2SxIXvHZ6CocIQo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)