UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+G2TJYSywes6/bUCLmju8qtfmpENi389+YR+10ngIqk=' 
WHERE 
  key_id = '3590daf9375e2872163e49e921b05e4c2409d0925115db01bc2c83efa534d273' 
  AND (
    token = '+G2TJYSywes6/bUCLmju8qtfmpENi389+YR+10ngIqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016