UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sJXn2DoO0aOtqS2/NsVLEOykxNfhiUZ11ZRu3wFUpP8=' 
WHERE 
  key_id = '76ba10d375cdf006444b9aad6f0084d9c31350fb8e4cb74508c90a04e0c05fc0' 
  AND (
    token = 'sJXn2DoO0aOtqS2/NsVLEOykxNfhiUZ11ZRu3wFUpP8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034