UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b3k6PkgfAuFbMB557hcblVPmtRy9oL7eF3RRWwmXajY='
WHERE
key_id = '9c2b88ac67828bcd3fbb965bfdea46d1d61d27cde0d9d048ae0174bd26f11962'
AND (
token = 'b3k6PkgfAuFbMB557hcblVPmtRy9oL7eF3RRWwmXajY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)