UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5/1cNswDVRwRNIyDsUwVBtNW4IN05qzhip2Lx+Fd7Qs=' 
WHERE 
  key_id = '06d58dc5bd49432cea585f7b15d01836088c97f8d1592882070b77f78e6ef4c7' 
  AND (
    token = '5/1cNswDVRwRNIyDsUwVBtNW4IN05qzhip2Lx+Fd7Qs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019