UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2btJFQmqJeiNbgCq/bVRswtAZjLuLNBHnn97sPIWgDg=' 
WHERE 
  key_id = 'adb7540ae3e8330fc1b11937eed2a2966a8cc7dc17022e9988a79f8efe21439e' 
  AND (
    token = '2btJFQmqJeiNbgCq/bVRswtAZjLuLNBHnn97sPIWgDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038