UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ZbkglmepLeG5JXQpgjsgjKxpFbN5QV2Vxwb2tAGRPg='
WHERE
key_id = '827a563fd24e03f5f852149fe2b65093cc6e541e4c2dd36dba51b47a7f2b44dc'
AND (
token = '2ZbkglmepLeG5JXQpgjsgjKxpFbN5QV2Vxwb2tAGRPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)