UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LueS/Ohq2n9swVu+rMsmppqdIZ/TIk9vFlNDKxToKiE=' 
WHERE 
  key_id = '0f68e0cfb4922169f2a9b312e22efc4b901ade545dc02f3a25cfc784f859ae80' 
  AND (
    token = 'LueS/Ohq2n9swVu+rMsmppqdIZ/TIk9vFlNDKxToKiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037