UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RYKHkGMW7I6F8LrXetfwhJuQJOPrkoImeuk/24r8kH4='
WHERE
key_id = '9f78190f5bc0c0053787e1b5acee178795c8b1d42ce45c71d5d7cab1375555f0'
AND (
token = 'RYKHkGMW7I6F8LrXetfwhJuQJOPrkoImeuk/24r8kH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)