UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6x35H8kslOC8sRxDVN+wFMJB13iXzAaWbXI+tKnGoTE=' 
WHERE 
  key_id = '71c6f50d59e9b26d1359635068bf160e9ef545572fe49d7180b21b863cb5572d' 
  AND (
    token = '6x35H8kslOC8sRxDVN+wFMJB13iXzAaWbXI+tKnGoTE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019