UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gzcVgBaZdNTfR1MKIt1TnVswKUMyi6MU0Mj2n6M2zDY='
WHERE
key_id = '84845296aeb41bdf978cbf66773df53e7371a83e0621f63e95602fbb7ab5f79c'
AND (
token = 'gzcVgBaZdNTfR1MKIt1TnVswKUMyi6MU0Mj2n6M2zDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)