UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zhVRHHzrjrd8l4j2yxYYGtefTrpVqOXXz2dWvkJ18KI=' 
WHERE 
  key_id = '78830a6529db02ee059ffd014095a23d7cbad41ccd54d7d68dae4104a158cce5' 
  AND (
    token = 'zhVRHHzrjrd8l4j2yxYYGtefTrpVqOXXz2dWvkJ18KI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028