UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CLGZVZZ8W//bRaiQtBL4LSd4wdMS3zSPLmo4eHyKfrA='
WHERE
key_id = '02c381cef3c3f19e99a8326b641b8a66d6399843ed93cc7fbe26f7d66b06e547'
AND (
token = 'CLGZVZZ8W//bRaiQtBL4LSd4wdMS3zSPLmo4eHyKfrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)