UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tkZoEmZADB77FFpVPfrKpURX2R0M6aWFGJLUAyhyurM=' 
WHERE 
  key_id = 'b08b69e59ed5f118bd36589ed8057df6f83cebdb5142e1f25147d361c19b1ba7' 
  AND (
    token = 'tkZoEmZADB77FFpVPfrKpURX2R0M6aWFGJLUAyhyurM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034