UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IVyQq/DFnfVWGIGtujm7WjogBP1queEDDagiMmyeINY=' 
WHERE 
  key_id = '95effeec023385744d20415188d3e4a2e6b1cf995a5784af2efce72368d50dc4' 
  AND (
    token = 'IVyQq/DFnfVWGIGtujm7WjogBP1queEDDagiMmyeINY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031