UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1NKJOyPCL/7bb9TZ1vZ853Oaqu5gGm7uPvJRZX1m2oU=' 
WHERE 
  key_id = '48da7e8dcded59607fe78f985ff2fdd9cdde83b8c400bc1bbd13b478a48d25de' 
  AND (
    token = '1NKJOyPCL/7bb9TZ1vZ853Oaqu5gGm7uPvJRZX1m2oU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034