UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MKn01Juisohajjhz+EGlM93gz05FY/VmUbvc1yStHI8='
WHERE
key_id = 'f83dd9c5fb45448ffadabde7bc7e0be735ac284305330a69757fdf23f998eaec'
AND (
token = 'MKn01Juisohajjhz+EGlM93gz05FY/VmUbvc1yStHI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)