UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ixVYFJmE3EL1Dxth47n9GrsuJ9pNKmbkbji+MgpJN9M='
WHERE
key_id = 'b6f2aee1919c0d86788e04efc1c64cb800393b2cd05a5fdb5664e94c21955a17'
AND (
token = 'ixVYFJmE3EL1Dxth47n9GrsuJ9pNKmbkbji+MgpJN9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)