UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Euzfrrxos1c+y7d+nDBQF8zU1GLhe1IB75nL5RSPzM=' 
WHERE 
  key_id = '818005296417f15db47c77a34079efbb0c526ede833a9337f0ab2eab13d8d678' 
  AND (
    token = '1Euzfrrxos1c+y7d+nDBQF8zU1GLhe1IB75nL5RSPzM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029