UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vfUu75clPNjPr8lyonL6sTDHtR8C9FTdnPesJ9YLRLs='
WHERE
key_id = '84c8afe5b282d3344aecdd4f789ff414d2005aa35bd6b8341161d070e8958bc1'
AND (
token = 'vfUu75clPNjPr8lyonL6sTDHtR8C9FTdnPesJ9YLRLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)