UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7mcEoX+R+ZCQ+UyO3/byYh84KEivEfaGfmJxh8EOP7U='
WHERE
key_id = '3eec3d07bc8a6939c9d1856723713ebc4037b52e9fb14f259fd9857627fa486b'
AND (
token = '7mcEoX+R+ZCQ+UyO3/byYh84KEivEfaGfmJxh8EOP7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)