UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PtHifMX0EwTw8DqUvvMNpoYoS87yoFiSEB3Pj+QnPX4=' 
WHERE 
  key_id = '72c2f986a8f31e0d8bba09275a9806cfeafb6b7a51ce7a446a9b0c2ce208808c' 
  AND (
    token = 'PtHifMX0EwTw8DqUvvMNpoYoS87yoFiSEB3Pj+QnPX4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022