UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FHunCyvQu/5yJcKcPIqYhVNxh6ydcpI/QvVED2+wIQ8=' 
WHERE 
  key_id = '6370ee920c21678179cd963a4c965d34bfb9aa505a1a227927e8fae8347b2794' 
  AND (
    token = 'FHunCyvQu/5yJcKcPIqYhVNxh6ydcpI/QvVED2+wIQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024