UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QNvAMMt5/UL6OGGiKRHMgZU3vytcKHk/ojcuF2dB8nM='
WHERE
key_id = '66a8bbb7fa614c814a7ea3ce1a1a1b7db9a91c1d46edaed47187ca10109f3a9d'
AND (
token = 'QNvAMMt5/UL6OGGiKRHMgZU3vytcKHk/ojcuF2dB8nM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)