UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XVj2nMHkvsv82XCux4g9tIl/iHzlQVFGLVQrJlBlpKU=' 
WHERE 
  key_id = 'a6888db4025841f13a73a1fae1a474f8c63d47229b07623463bb3f7671cb392b' 
  AND (
    token = 'XVj2nMHkvsv82XCux4g9tIl/iHzlQVFGLVQrJlBlpKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025