UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5oZAxAr0i0XjR7Q/Urf0lpan6Vs72UTAuR96tnzgHm8='
WHERE
key_id = '2c1d89c9d819b9d4c5c8781daa09f151ca10145dd289f76d52bb7998a7d10d60'
AND (
token = '5oZAxAr0i0XjR7Q/Urf0lpan6Vs72UTAuR96tnzgHm8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)